SLD
Section: User Commands (1)
Updated: 14 April 1987
Index
Return to Main Contents
NAME
sld - SPUR link editor
SYNOPSIS
sld
[ -A basefile ]
[ -d ]
[ -e entry ]
[ -j ]
[ -lx ]
[ -Ldir ]
[ -N ]
[
-o name
] [
-p[d]
] [
-pt
] [
-r
]
[
-s
] [
-S
]
[
-T[text] hex
] [
-Tdata hex
] [
-Tsdata hex
]
[
-u name
] [
-w
] [
-x
] [
-X
]
[ -ysym ]
[
-z
]
file ...
DESCRIPTION
sld
combines several object programs into one, resolves external references,
and searches libraries. In the simplest case several object
files
are given, and
sld
combines them, producing an object module which can be either executed or
become the input for a further
sld
run. In the latter case, the
-r
option must be given to preserve the relocation bits. The output of
sld
is left on a file called
a.out
if not otherwise specified by the
-o
option. The output file
is made executable only if no errors occurred during the load, and the
-N
and
-r
options were not specified.
The argument
files
are concatenated in the order specified. The entry
point of the output is the beginning of the text unless the
-e option is specified.
If any
file
is a library, it is searched exactly once at the point it
is encountered in the argument list. Only those routines defining an
unresolved external reference are loaded. The library must have been
processed by
ranlib(1);
its first member must be a file named `__.SYMDEF',
which is the dictionary for the library.
The dictionary is searched iteratively to satisfy as many references as possible.
The symbols _etext, _edata, _end,
_bpdata, and _bpbss (etext,
edata, end, bpdata, and bpbss
in C) are reserved, and if referred to, are set
to the first location above the program, the first location above initialized
shared data, and the first location above all shared data, the beginning
of private initialized data, and the beginning of uninitialized private
data, respectively.
It is erroneous to define these symbols.
OPTIONS
Options should appear before the file names, except abbreviated library
names specified by the
-l
option which can appear anywhere.
- -A name
-
Incremental loading: the
resulting object may be read into an already executing program.
name
is the name of a file that supplies the initial symbol table for the
resulting object file. Only newly linked material is
entered into the text and data portions of
a.out,
but the new symbol table will reflect all symbols defined before and after
the incremental load. This argument must appear before any other object
file in the argument list. One or more of the
-T
options may be used as well, and will be taken to mean that the newly linked
segments will commence at the corresponding addresses (which must
divisible by 8). By default, text and private data are concatenated.
The default starting point for text is the old value of
_end.
The default starting point for shared data is the old value of
_edata_s.
The values of _etext, etc., are the same for the resulting
object file as they were for
name.
- -d
-
Force definition of common storage even if the
-r
flag is present.
- -e entry
-
Define the entry point: entry argument is the name of the
entry point of the loaded program.
- -j
-
Join private data to the end of text. This is the default for the
-N
option. The switch is ignored if overridden by the
-Tdata
or
-pd
options.
- -lx
-
This option is an abbreviation for the library name `dir/libx.a'.
Here,
x
is a string.
Dir is one of the directories listed in preceding
-L options, or, if no such file exists,
then one of the directories `/lib', `/lib/local', or `/usr/local/lib' (tried
in that order).
A library is searched when its name is encountered, so the placement of a
-l
is significant.
- -Ldir
-
See -l above.
- -N
-
Do not make the text portion read only or sharable. The data portion
immediately follows the text, which is relocated to begin at address 0
(i.e., not preceded by the header).
(Use `magic number' 0507.)
- -o name
-
Name
is the name of the
sld
output file, instead of
a.out.
- -p[d]
-
`Publicize' private data segment. The initialized
private data in each object file
is concatenated to the front of the initialized shareable data of that
file, and relocated as shareable data.
Likewise, the uninitialized private data is concatenated to the front of the
uninitialized shared data.
The -Tdata option, if present,
is ignored.
The -Tsdata option is honored, and governs the position of the
combined segment. The names
_edata
and
_end
(edata and end in C) are set
to the values of _edata_s and _end_s, respectively.
- -pt
-
Publicize text segment. The text segments of the object files are concatenated
together at the from of the initialized shareable data of that file, and
relocated as shareable data. The -Ttext option, if present, only affects the
placement of private data (when this follows the text segment), and has
no effect on the placement of text. The -Tsdata option is honored, and
governs the position of the combined segment.
- -r
-
Generate relocation bits in the output file
so that it can be the subject of another
sld
run. This flag also prevents final definitions from being given to common
symbols, and suppresses the `undefined symbol' diagnostics.
It implies the
-N
option.
- -s
-
Strip the output, that is, remove the symbol table and relocation bits to save
space (but impair the usefulness of the debuggers). This information can also
be removed by
strip(1).
- -S
-
Strip the output by removing all symbols except locals and globals.
- -T[text] hex
-
Relocate as if the text (i.e., exclusive of the header) started at
address
hex
(a hexadecimal number, possibly with preceding `0x'). This does not
affect where the text is actually loaded; loading the file in the
usual way will place the text segment at its standard location,
relocated as if it were at address hex.
- -Tdatahex
-
Relocate the private data segment as if it started at location
hex (a hexadecimal number as above). Again, this does not
affect where the private data segments are actually loaded.
- -Tsdatahex
-
Relocate the shared data segment as if it started at location
hex (a hexadecimal number as above). This does not
affect where the shared data segments are actually loaded.
- -u name
-
Enter name as an undefined symbol. This is useful for loading
wholly from a library, since initially the symbol table is empty and an
unresolved reference is needed to force the loading of the first routine.
- -w
-
Each time an object file is automatically included from a library,
indicate the name of the object file and a symbol that caused it to be
loaded.
- -x
-
Do not preserve local (non-.globl) symbols in the output symbol
table; only enter external symbols.
This option saves some space in the output file.
- -X
-
Save local symbols except for those whose names begin with `L'.
This option is used by
cc(1)
to discard internally-generated labels while
retaining symbols local to routines.
- -ysym
-
Display each file in which
sym
appears, its type and whether the file defines or references it.
Many such options may be given to trace many symbols.
It is usually necessary to begin
sym
with an `_', as external C, FORTRAN and Pascal variables begin
with underscores.
- -z
-
Arrange for the process to be loaded on demand from the resulting executable
file (0513 `magic number') rather than preloaded.
This is the default (and is present here only for compatibility).
In the resulting object file, the sizes of the text segment and initialized data
segments are multiples of the page size (padded with nulls, if
necessary). When loaded in the usual
way, they all start on page boundaries, allowing easy demand loading
from the object file.
The header is incorporated in the first page of text.
With this format the first few BSS segment symbols may actually end up
in the initialized data segment, and likewise for SBSS segment symbols
and the shared data segment;
this is to avoid wasting the space resulting from rounding up
the data segment sizes.
FILES
/lib/lib*.a libraries
/usr/lib/lib*.a more libraries
/usr/local/lib/lib*.a still more libraries
a.out output file
SEE ALSO
sas(1), ar(1), cc(1), ranlib(1), strip(1)
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- OPTIONS
-
- FILES
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 22:50:04 GMT, December 11, 2024